import Layout from '@/layout';

const myAssetRoute = [
  {
    path: '/my-asset',
    redirect: '/my-asset/index',
    name: 'my-asset',
    component: Layout,
    children: [
      {
        path: '',
        name: '',
        component: () => import('@/views/my-asset'),
        props: route => ({
          $title: route.query.title,
          $type: route.query.type
        })
      },
      {
        path: '/my-collecting',
        name: 'my-collecting',
        component: () => import('@/views/my-asset/my-collecting'),
        props: route => ({
          $title: route.query.title,
          $type: route.query.type
        })
      },
      {
        path: '/my-collecting-detail',
        name: 'my-collecting-detail',
        component: () => import('@/views/my-asset/my-collecting-detail'),
        props: route => ({
          $title: route.query.title,
          $type: route.query.type,
          $operate: route.query.operate,
          $edit: route.query.edit,
          id: route.query.id
        })
      },
      {
        path: '/my-lost',
        name: 'my-lost',
        component: () => import('@/views/my-asset/my-lost'),
        props: route => ({
          $title: route.query.title,
          $type: route.query.type
        })
      },
      {
        path: '/my-lost-detail',
        name: 'my-lost-detail',
        component: () => import('@/views/my-asset/my-lost-detail'),
        meta: { title: '资产报失详情' }
      },
      {
        path: '/asset-detail',
        name: 'asset-detail',
        component: () => import('@/views/my-asset/asset-detail'),
        meta: { title: '资产详情' },
        props: route => ({
          $type: route.query.type
        })
      },
      {
        path: '/consumables-detail',
        name: 'consumables-detail',
        component: () => import('@/views/my-asset/consumables-detail'),
        meta: { title: '耗材详情' },
        props: route => ({
          $type: route.query.type
        })
      },
      {
        path: '/record',
        name: 'record',
        component: () => import('@/views/my-asset/record'),
        props: route => ({
          $operate: route.query.operate,
          $type: route.query.type,
          $title: route.query.title
        })
      },
      {
        path: '/asset-info-record',
        name: 'asset-info-record',
        component: () => import('@/views/my-asset/asset-info-record'),
        props: route => ({
          $title: route.query.title,
          $operate: route.query.operate
        })
      }
    ]
  }
];

export default myAssetRoute;
